package com.acme.bankapp.domain.bank;


public class SavingsAccount extends AbstractAccount {
	
	public SavingsAccount(double balance) 
	{
		setBalance(balance);
	}

	@Override
	public void deposit(double x) 
	{
		setBalance(getBalance() + x);
	}
	
	@Override
	public void withdraw(double x) 
	{
	/*
		if (getBalance() >= x) 
		{
			setBalance(getBalance() - x);
		} 
		else 
		{
			//exception: not enough money
		}
	*/
		setBalance(getBalance() - x);
		assert getBalance() > 0;
	}

	@Override
	public double maximumAmountToWithdraw() {
		return getBalance();
	}

}
